a = input()
b = input().split(" ")
b = [int(i)for i in b]
c = set(b)
b = list(c)
b.sort()
print(len(b))
for i in b:
    print(i, end=' ')
